import ajax from '@/api/apiConfig.js'

/*获取组织树结构 */
export const getDepartmentTree = (data) => {
  return ajax.get('department/getDepartmentTree', data)
}

/*获取组织部门包含的用户 */
export const getDepartmentUserList = (data) => {
  return ajax.get('department/getDepartmentUserList', data)
}

/*删除树节点 */
export const deleteDepartment = (data) => {
  return ajax.post('department/deleteDepartment', data)
}

/*将用户从组织部门中移除 */
export const deleteUserFromDepartment = (data) => {
  return ajax.post('department/deleteUserFromDepartment', data)
}

/*添加/编辑组织部门 */
export const saveDepartment = (data) => {
  return ajax.post('department/saveDepartment', data)
}

/*分配用户 */
export const addUserOnDepartment = (data) => {
  return ajax.post('department/addUserOnDepartment', data)
}

/*员工/组织绩效列表 */
export const getPerRecordsList = (data) => {
  return ajax.get('performance/getPerRecordsList', data)
}

/*员工/组织绩统计表 */
export const getPerRecordsStatistics = (data) => {
  return ajax.get('performance/getPerRecordsStatistics', data)
}

/*获取员工/组织绩效明细 */
export const getPerRecordsDetail = (data) => {
  return ajax.get('performance/getPerRecordsDetail', data)
}

/*获取员工/组织绩效规则表 */
export const getPerConfigInfo = (data) => {
  return ajax.get('performance/getPerConfigInfo', data)
}

/*获取学习资料列表 */
export const selectLearningMaterialsList = (data) => {
  return ajax.get('materials/selectLearningMaterialsList', data)
}

/*获取学习资料详情 */
export const getLearningMaterialsDetail = (data) => {
  return ajax.get('materials/getLearningMaterialsDetail', data)
}

/*删除学习资料 */
export const deleteLearningMaterials = (data) => {
  return ajax.post('materials/deleteLearningMaterials', data)
}

/*添加/编辑学习资料 */
export const saveLearningMaterials = (data) => {
  return ajax.post('materials/saveLearningMaterials', data)
}

/*统计文章的每个用户的学习时长 */
export const selectLearningTimeByAccount = (data) => {
  return ajax.get('materials/selectLearningTimeByAccount', data)
}

/*修改员工/组织绩效规则 */
export const updatePerInfo = (data) => {
  return ajax.post('performance/updatePerInfo', data)
}